<template>
  <div>
  </div>
</template>
<script>
  import axios from 'axios'

  export default {
    data() {
      return {}
    },
    created() {
      this.getid();
    },
    mounted() {

    },
    methods: {
      getUrlParms(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
          return unescape(r[2]);
        return null;
      },
      getid() {
        // sessionStorage.setItem('areaId', "0000078");
        // sessionStorage.setItem('urseName', "Admin");
        // this.$router.push('/home');

        let vm = this;
        axios.post('/api/cilent/validate?key=' + this.getUrlParms("id"))
          .then(res => {
            if (res.data.status == "success") {
              sessionStorage.setItem('areaId', res.data.data);
              this.$router.push('/home');
            }
            if (res.data.status == "error") {
              alert(res.data.message)
            }
          })
          .catch(err => {
          })
      },
    },

  }

</script>
<style scoped>

</style>
